/// <reference path="../../wx/ad/WxBannerAd.ts" />

namespace mgp.ads{
    export class QqBannerAd extends WxBannerAd{

        protected _bannerReadyShow() {
            if(this._bannerLoaded){
                this._bannerShow()
            }
        }
        
        protected _onBannerLoaded(res) {
            super._onBannerLoaded(res);
            this._bannerShow()
        }

        protected _getDefStyle(width?: number, height?: number) {
            let info = this._getSystemInfoSync();
            let offsetY = this._onIOS() && this._isLongPhone() ? 16 : 0;
            let defWidth = width || 300;
            let defHeight = height || 90;
            let style: IBannerStyle = {}
            style.left = (info.screenWidth - defWidth) / 2;
            style.top = info.screenHeight - defHeight - offsetY;
            style.width = defWidth;
            style.height = defHeight;
            return style;
        }
    }
}